<?php
require_once ('../../public/config/config.php');
require_once ('../class/Book.class.php');

$bookCode = $_POST['bookcode'];

$book = Book::GetByBookCode($bookCode);
if($book){

	$bookInfo = array();
	$bookInfo['id'] = $book->bookID;
	$bookInfo['name'] = $book->bookName;
	$bookInfo['author'] = $book->bookAuthor;
	$bookInfo['qty'] = $book->bookQty;

	$bookInfoJson = json_encode($bookInfo);
	echo $bookInfoJson;

}else{
	echo "false";
}
?>